<body>
    <div class="x-body">
        <div class="pd-20">
            <style type="text/css">
                .title{background: #F2F2F2;}
                #content{width: 100%;height: 250px;border: 0;resize: none;}
            </style>
            <form class="layui-form">
                <table class="layui-table layui-form-item">
                    <tbody id="x-link">
                        <tr>
                            <th width="80" class="title">
                                答题ID：
                            </th>
                            <td name='aid'>
                                {$content['aid']}
                            </td>
                        </tr>
                        <tr id="content-box">
                            <th width="80" class="title">
                                内容：
                            </th>
                            <td>
                                <textarea type="text" name="content" id="content">
                                    {$content['content']}
                                </textarea>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="layui-form-item">
                    <label for="L_repass" class="layui-form-label">
                    </label>
                    <button  class="layui-btn" lay-filter="save" lay-submit="">
                        保存
                    </button>
                </div>
            </form>
        </div>
    </div>
    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form()
          ,layer = layui.layer;

          //监听提交
          form.on('submit(save)', function(data){
            console.log(data.field);
            //发异步，把数据提交给php
            // $.post('{:U('admin/admin/admin_edit')}', {data: data.field}, function(response) {
            //     console.log(response);
            //     if(response.type == 1){
            //         layer.alert(response.info, {icon: 6},function () {
            //             // 获得frame索引
            //             var index = parent.layer.getFrameIndex(window.name);
            //             //关闭当前frame
            //             parent.layer.close(index);
            //             parent.location.reload();
            //         });
            //     } else if(response.type == 0) {
            //         layer.msg(response.info, {icon: 5});
            //     }
            // });
            return false;
          });
        });

        $('#content-box').mousemove(function () {
            $(this).children('td').children('textarea').css({
                'background-color': '#F8F8F8'
            });
        });

        $('#content-box').mouseout(function () {
            $(this).children('td').children('textarea').css({
                'background-color': '#FFF'
            });
        });
    </script>
</body>